//#include <CGAL/Homogeneous.h>
//#include <CGAL/Nef_polyhedron_3.h>
//typedef CGAL::Homogeneous<long>  Kernel;
//typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
//int main() {
//	Nef_polyhedron N0(Nef_polyhedron::EMPTY);
//	Nef_polyhedron N1(Nef_polyhedron::COMPLETE);
//	CGAL_assertion(N0 == N1.complement());
//	return 0;
//}

#include <CGAL/Nef_polyhedron_3.h>  
#include <CGAL/Polyhedron_3.h>  
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>  

typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;//this kernel for .off boolean operation, fast and precise  
typedef CGAL::Nef_polyhedron_3<Kernel>  Nef_polyhedron;
typedef CGAL::Polyhedron_3<Kernel>         Polyhedron;
typedef Kernel::Plane_3  Plane_3;
using namespace std;
int main()
{ 
	//load cube.off   
	Polyhedron cube; 
	Nef_polyhedron nef_cube(cube);
	//load torus.off    
	Polyhedron torus; 
	Nef_polyhedron nef_torus(torus);
	//operation  
	Nef_polyhedron nef_res = nef_torus * nef_cube;
	if (nef_res.is_simple())
	{
		Polyhedron result;
		nef_res.convert_to_polyhedron(result);
 
	}
	else
	{
		cerr << "nef_res is not a 2-manifold." << endl;
	}
	 
	system("pause");
	return 0;
}